<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>2.平行四边形</title>
    <style>
        .block{
            width: 300px;
            height: 300px;
            position: relative;
            
            border: 1px dashed red;

            margin: auto;

        }

        .block::before{
            position:absolute;
            width: 100%;
            height: 50%;
            background: #ddd;
            z-index: -1;
            content: '';
            /* transform: skewX(30deg); */
            transform: skew(30deg, 0);
        }
        
        .block::after{
            position:absolute;
            width: 100%;
            height: 50%;
            top: 50%;
            left: 0;
            content: '';
            background: #ddd;
            z-index: -1;
            transform: skewX(-30deg);
        }
    </style>
</head>

<body>

    <div class="block">
这是文字哈哈哈
    </div>



</body>

</html>